﻿using System;
using System.Collections;
using FlowCanvas;
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
using UnityEngine.Playables;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class ClientReport : LatentActionNodeBase
    {
        [RequiredField]
        public BBParameter<int> eventId;
        
        private bool stopped = false;

        public override bool allowRoutineQueueing { get { return false; } }
        
        public IEnumerator Invoke()
        {
            BlueprintUtils.ClientReport(eventId.value);
            yield return new UnityEngine.WaitUntil(() =>
            {
                return true;
            });
        }
        
        protected override void OnRegisterDerivedPorts(FlowNode node)
        {
            node.AddFlowInput("In", (f) => { Begin(Invoke(), f); });
        }
    }
}